﻿using Microsoft.Xna.Framework;

using Ah.Testudin.Engine.Actors;
using System.Collections.Generic;

namespace Ah.Testudin.Engine.Physics
{
    public interface IPhysicsSimulator
    {
        GetActorDelegate GetActorDelegate { set; }

        void Initialize();

        void Update(GameTime gameTime);

        void AddSphere(
            float radius,
            float gravityAcceleration,
            Actor actor,
            Matrix initialTransform);

        void AddCube(
            Vector3 dimensions,
            float gravityAcceleration,
            Actor actor);

        void AddCapsule(
            Vector3 dimensions,
            float gravityAcceleration,
            Actor actor);

        void AddPointCloud(
            IEnumerable<Vector3> vertices,
            float gravityAcceleration,
            int numPoints,
            Actor actor);

        void RemoveActor(ActorId actorId);

        void ApplyForce(
            Vector3 direction,
            float newtons,
            ActorId actorId);

        void ApplyTorque(
            Vector3 direction,
            float magnitude,
            ActorId actorId);

        bool KinematicMove(
            ActorId actorId,
            Matrix newTransform);

        void CreateTrigger(
            Actor actor,
            Vector3 position,
            float dimension);

        Vector3 GetVelocity(ActorId actorId);

        void SetVelocity(
            ActorId actorId,
            Vector3 velocity);

        void RenderDiagnostics();
    }
}
